package cn.hanna.springcloudalibaba.service.impl;

import cn.hanna.springcloud.entities.CommonResult;
import cn.hanna.springcloudalibaba.dao.StorageMapper;
import cn.hanna.springcloudalibaba.service.StorageService;
import lombok.extern.java.Log;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author smileha
 * @create 2021-10-23 0:44
 * @description
 */
@Service
@Slf4j
public class StorageServiceImpl implements StorageService {

    @Resource
    private StorageMapper storageMapper;

    @Override
    public void decrease(Long productId, Integer count) {
        log.info("------------>库存微服务减少库存");
        System.out.println("==========count:"+count);
        storageMapper.decrease(productId,count);
        log.info("------------>库存微服务减少库存完成");
    }
}
